package WordCount;

public class CaseIngnoreWordCountMapper implements BaseMapper {

    public void map(String line, BaseContext baseContext) {

        // 按照空格进行分割，将单词全部转换成小写
        String[] words = line.toLowerCase().split(" ");
        for (String word: words){
            Integer value = baseContext.get(word);
            if (value == null){
                baseContext.write(word,1);
            }
            else {
                baseContext.write(word,value + 1);
            }
        }
    }
}
